<html>
<head><meta charset="utf-8"><title>large_types_passed_by_value pointless? · clippy · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/index.html">clippy</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/large_types_passed_by_value.20pointless.3F.html">large_types_passed_by_value pointless?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="221306079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/large_types_passed_by_value%20pointless%3F/near/221306079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kangalioo <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/large_types_passed_by_value.20pointless.3F.html#221306079">(Dec 31 2020 at 17:57)</a>:</h4>
<p>Isn't the large_types_passed_by_value lint pointless because of Rust's calling convention?</p>
<p>As far as I know, Rust's calling convention currently passes large copy types by reference automatically, even if the function parameter is declared as move-by-value in the code.</p>



<a name="221310119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/large_types_passed_by_value%20pointless%3F/near/221310119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/large_types_passed_by_value.20pointless.3F.html#221310119">(Dec 31 2020 at 19:10)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/52274">This thread</a> seems to indicate the opposite.</p>



<a name="221310274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/large_types_passed_by_value%20pointless%3F/near/221310274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/large_types_passed_by_value.20pointless.3F.html#221310274">(Dec 31 2020 at 19:13)</a>:</h4>
<p>oh interesting, <a href="https://github.com/rust-lang/rust/issues/52274#issuecomment-404444999">https://github.com/rust-lang/rust/issues/52274#issuecomment-404444999</a> makes good points that this would make the calling convention depend on how the function is implemented</p>



<a name="221310798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/large_types_passed_by_value%20pointless%3F/near/221310798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kangalioo <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/large_types_passed_by_value.20pointless.3F.html#221310798">(Dec 31 2020 at 19:23)</a>:</h4>
<p>Interesting, it's really much more nuanced than I had thought. Nevermind my worry about this clippy lint being pointless, then</p>



<a name="221310917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/large_types_passed_by_value%20pointless%3F/near/221310917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/large_types_passed_by_value.20pointless.3F.html#221310917">(Dec 31 2020 at 19:25)</a>:</h4>
<p>No worries. I learned something!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>